const Router = require('koa-router');
const uploadRouter = new Router({
  prefix: '/upload'
});
const {verifyLogin} = require('../middlewares/auth.middleware');
const {savaAvatar,avatarInfo ,savePicture} = require('../controllers/file.controller');
const {avatarHandler,pictureHandler,pictureResize} = require('../middlewares/file.middleware');
// 上传头像
uploadRouter.post('/avatar', verifyLogin,avatarHandler,savaAvatar);
// 上传图片
uploadRouter.post('/picture', verifyLogin,pictureHandler,pictureResize,savePicture);
module.exports = uploadRouter;